/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PatrolItemsPanel.java
 *
 * Created on 2011-4-28, 10:06:10
 */
package com.hs.gs;

import com.hs.gs.domain.EvaluationItem;
import com.hs.gs.util.Utils;
import com.hs.gs.ws.EvaluationItemService;
import java.util.List;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 *
 * @author johnny
 */
public class SupervisorCheckItemsPanel extends javax.swing.JPanel {

    private List<EvaluationItem> items;
    /** Creates new form PatrolItemsPanel */
    public SupervisorCheckItemsPanel(Long categoryId) {
        JaxWsProxyFactoryBean bean = new JaxWsProxyFactoryBean();
        bean.setAddress(Utils.GetWSHostAddress() + "evaluationItem");
        bean.setServiceClass(EvaluationItemService.class);
        EvaluationItemService service = (EvaluationItemService) bean.create();
        items = service.getAllEvaluationItemsOfCategory(categoryId);
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();

        setName("Form"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTable1.setModel(new EvaluationTableModel(items));
        jTable1.setName("jTable1"); // NOI18N
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration//GEN-END:variables
}
